FROM docker.1ms.run/python:3.12-alpine

RUN set -eux && sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories \
    && apk add tzdata \
    && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime   \
    && echo "Asia/Shanghai" > /etc/timezone  \
    && apk del tzdata

WORKDIR /usr/src/app

COPY . .

RUN rm -rf .venv \
   && rm -rf data \
   && pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --no-cache-dir -r requirement.txt

ENTRYPOINT ["python","app.py"]